import React from 'react'

export default function Count() {
    console.log('-------render----------');
    const [count, setCount] = useState(0)
    const [age, setAge] = useState(10)
    const [money, setMoney] = useState(1000)
    useEffect(() => {
        console.log('------------------');
    }, [count, money])
    return (
        <div>
            <div>计数:{count}<button onClick={() => setCount(count + 1)}>+</button></div>
            <div>年龄:{age}<button onClick={() => setAge(age + 1)}>+</button></div>
            <div>存款:{money}<button onClick={() => setMoney(money + 1)}>+</button></div>

        </div>
    )
}
